using System.Text;

namespace OracleInternal.SqlAndPlsqlParser.LocalParsing
{
	internal class OracleLpColumnExpression : OracleLpSimpleExpression
	{
		protected bool m_vPlus;

		protected OracleLpColumn m_vColumn;

		public bool Plus
		{
			get
			{
				return m_vPlus;
			}
			set
			{
				m_vPlus = value;
			}
		}

		public OracleLpColumn Column
		{
			get
			{
				return m_vColumn;
			}
			set
			{
				m_vColumn = value;
			}
		}

		public OracleLpColumnExpression(OracleLpStatementElement parent)
			: base(parent)
		{
			m_vSimpleExpressionType = OracleLpSimpleExpressionType.COLUMN;
		}

		public override void EvaluateDatatype()
		{
		}

		internal override void ToString(StringBuilder sb)
		{
			base.ToString(sb);
			m_vColumn.ToString(sb);
		}

		public override string ToString()
		{
			StringBuilder stringBuilder = new StringBuilder();
			OracleLpName schemaName = m_vColumn.SchemaName;
			if (schemaName != null)
			{
				stringBuilder.Append(schemaName.DbName);
				stringBuilder.Append('.');
			}
			schemaName = m_vColumn.ParentObjectName;
			if (schemaName != null)
			{
				stringBuilder.Append(schemaName.DbName);
				stringBuilder.Append('.');
			}
			stringBuilder.Append(m_vColumn.Name.DbName);
			return stringBuilder.ToString();
		}
	}
}
